package com.xing.dao;

import com.xing.pojo.Book;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;


public interface BookDao {

    @Insert("insert into book values(null,#{type},#{name},#{description})")
     int save(Book book);
    @Update("update book set type = #{type},name = #{name},description = #{description} where id = #{id}")
     int update(Book book);
    @Delete("delete from book where id = #{id}")
     int delete(Integer id);
    @Select("select * from book where id = #{id}")
     Book getBookById(Integer id);
    @Select("select * from book")
     List<Book> getBookList();


}
